package com.leetcode.algorithm.y22.m07.w3;

/**
 * 48. 旋转图像
 * 
 * https://leetcode.cn/problems/rotate-image/submissions/
 * 
 * @author jie.deng
 *
 */
class Question0048Solution01 {

	public void rotate(int[][] matrix) {
		int len = matrix.length;
		int[][] mat = new int[len][len];
		for (int i = 0; i < len; i++) {
			for (int j = 0; j < len; j++) {
				mat[j][len - 1 - i] = matrix[i][j];
			}
		}

		for (int i = 0; i < len; i++) {
			for (int j = 0; j < len; j++) {
				matrix[i][j] = mat[i][j];
			}
		}
	}

}